﻿/*
 * ©2009-2010 XELF
 * http://xelf.info
 */

#if XNA || WINDOWS_PHONE
using Microsoft.Xna.Framework;
#endif

namespace XELF.Framework {
#if XNA || WINDOWS_PHONE
	public static partial class MatrixHelper {
#else
	public partial struct Matrix {
#endif
		/// <summary>
		/// スケーリング行列を作る。
		/// </summary>
		/// <param name="x">X</param>
		/// <param name="y">Y</param>
		/// <param name="z">Z</param>
		/// <param name="result"></param>
		public static void CreateScale(float x, float y, float z, out Matrix result) {
			result = new Matrix();
			result.M11 = x; result.M12 = 0; result.M13 = 0; result.M14 = 0;
			result.M21 = 0; result.M22 = y; result.M23 = 0; result.M24 = 0;
			result.M31 = 0; result.M32 = 0; result.M33 = z; result.M34 = 0;
			result.M41 = 0; result.M42 = 0; result.M43 = 0; result.M44 = 1;
		}
		/// <summary>
		/// スケーリング行列を作る。
		/// </summary>
		/// <param name="scale">スケール</param>
		/// <param name="result"></param>
		public static void CreateScale(float scale, out Matrix result) {
			CreateScale(scale, scale, scale, out result);
		}
		/// <summary>
		/// スケーリング行列を作る。
		/// </summary>
		/// <param name="scale">スケール</param>
		/// <returns></returns>
		public static Matrix CreateScale(float scale) {
			Matrix result;
			CreateScale(scale, out result);
			return result;
		}
	}

}
